package edu.sctu.zcy.month201505.day20150529.synchronize;

/**
 * Created by user24 on 2015/5/29.
 */
public class ReadWrite extends Thread {


    SynchronizeDemo synchronizeDemo = new SynchronizeDemo();

    private boolean flag;

    public ReadWrite(boolean flag){
        this.flag = flag;
    }

    @Override
    public void run() {
        if(flag){

            synchronizeDemo.write();

        }else {

            synchronizeDemo.read();

          }
    }
}
